import cmps from "@/views/engineeringManage/components/filterComponents";
/**
 * 表头字段
 */

export const tableHeaders = [
  {
    value: "customerName",
    label: "客户",
    isSort: false,
    isSelect: true,
    fixed: "left",
    minWidth: "260",
    filterList: [
      {
        title: "客户",
        filterId: "customer_name",
        condition: [
          {
            label: "模糊筛选",
            value: "like"
          }
        ],
        option: {
          type: "TextInput",
          lazy: false,
          dataSource: {},
          data: []
        },
        compare: "like",
        value: [""]
      }
    ]
  },
  {
    value: "portraitName",
    label: "业务类型",
    isSelect: true,
    minWidth: "120",
    filterList: [
      {
        filterId: "portrait_id",
        title: "业务类型",
        condition: [
          {
            label: "等于",
            value: "in"
          },
          {
            label: "不等于",
            value: "notIn"
          }
        ],
        option: {
          type: "MultipleSelect",
          lazy: true,
          dataSource: {
            type: "url",
            value: "/crm/system/filter/portraitList"
          },
          data: []
        },
        compare: "in",
        value: []
      }
    ]
  },
  {
    value: "area",
    label: "面积",
    isSelect: false,
    isSort: false,
    minWidth: "117",
    filterList: []
  },
  {
    value: "principal",
    label: "负责人",
    isSelect: true,
    isSort: true,
    minWidth: "140",
    filterList: [
      {
        title: "负责人",
        filterId: "principal_id",
        condition: [
          {
            label: "在列表",
            value: "jsonIn"
          }
        ],
        option: {
          type: "SelectInput",
          lazy: false,
          dataSource: {},
          data: [
            {
              label: "空",
              value: "blank"
            }
          ]
        },
        compare: "jsonIn",
        value: []
      }
      // {
      //   title: "负责人角色",
      //   filterId: "principal_role_id",
      //   condition: [
      //     {
      //       label: "等于",
      //       value: "in"
      //     },
      //     {
      //       label: "不等于",
      //       value: "notIn"
      //     }
      //   ],
      //   option: {
      //     type: "MultipleSelect",
      //     lazy: true,
      //     dataSource: {},
      //     data: []
      //   },
      //   compare: "in",
      //   value: []
      // },
      // {
      //   title: "负责人部门",
      //   filterId: "principal_dept_id",
      //   condition: [
      //     {
      //       label: "等于",
      //       value: "in"
      //     },
      //     {
      //       label: "不等于",
      //       value: "notIn"
      //     }
      //   ],
      //   option: {
      //     type: "MultipleSelect",
      //     lazy: true,
      //     dataSource: {},
      //     data: []
      //   },
      //   compare: "in",
      //   value: []
      // }
    ]
  },
  {
    value: "buildStatusDisplay",
    label: "状态",
    isSelect: true,
    isSort: false,
    minWidth: "150",
    filterList: [
      {
        filterId: "build_status",
        title: "状态筛选",
        condition: [
          {
            label: "等于",
            value: "in"
          },
          {
            label: "不等于",
            value: "notIn"
          }
        ],
        option: {
          type: "MultipleSelect",
          lazy: false,
          dataSource: {},
          data: [
            {
              label: "未开始",
              value: "not_start"
            },
            {
              label: "正常",
              value: "ing"
            },
            {
              label: "超期",
              value: "time_out"
            },
            {
              label: "延期风险",
              value: "delay_risk"
            },
            {
              label: "已停工",
              value: "shutdown"
            },
            {
              label: "已交付",
              value: "complete"
            }
          ]
        },
        compare: "in",
        value: []
      },
      {
        filterId: "time_out_day",
        title: "超期天数",
        condition: [
          {
            label: "大于",
            value: "gt"
          },
          {
            label: "小于",
            value: "lt"
          },
          {
            label: "等于",
            value: "eq"
          }
        ],
        option: {
          type: "InputSelect",
          lazy: false,
          dataSource: {},
          data: []
        },
        compare: "gt",
        value: []
      }
      // {
      //   filterId: "delay_risk_day",
      //   title: "延期天数",
      //   condition: [
      //     {
      //       label: "大于",
      //       value: "gt"
      //     },
      //     {
      //       label: "小于",
      //       value: "lt"
      //     },
      //     {
      //       label: "等于",
      //       value: "eq"
      //     }
      //   ],
      //   option: {
      //     type: "InputSelect",
      //     lazy: false,
      //     dataSource: {},
      //     data: []
      //   },
      //   compare: "gt",
      //   value: []
      // },
      // {
      //   filterId: "shutdown_days",
      //   title: "停工天数",
      //   condition: [
      //     {
      //       label: "大于",
      //       value: "gt"
      //     },
      //     {
      //       label: "小于",
      //       value: "lt"
      //     },
      //     {
      //       label: "等于",
      //       value: "eq"
      //     }
      //   ],
      //   option: {
      //     type: "InputSelect",
      //     lazy: false,
      //     dataSource: {},
      //     data: []
      //   },
      //   compare: "gt",
      //   value: []
      // }
    ]
  },
  {
    value: "shutdownCause",
    label: "停工原因",
    isSort: false,
    isSelect: false,
    width: 130,
    filterList: []
  },
  {
    value: "shutdownDate",
    label: "停工日期",
    isSort: false,
    isSelect: false,
    width: 130,
    filterList: []
  },
  {
    value: "factStartDate",
    label: "开工日期",
    isSort: true,
    isSelect: true,
    minWidth: "140",
    filterList: [
      {
        title: "开工日期",
        filterId: "fact_start_date",
        condition: [
          {
            label: "时间范围",
            value: "between"
          },
          {
            label: "大于某日",
            value: "gt"
          },
          {
            label: "等于某日",
            value: "eq"
          },
          {
            label: "小于某日",
            value: "lt"
          }
        ],
        option: {
          type: "SelectInput",
          lazy: false,
          dataSource: {},
          data: []
        },
        compare: "between",
        value: []
      }
    ]
  },
  {
    value: "stageProcess",
    label: "阶段进度",
    isSort: true,
    isSelect: true,
    minWidth: "140",
    filterList: [
      {
        title: "阶段进度",
        filterId: "stage_id",
        condition: [
          {
            label: "在列表",
            value: "jsonIn"
          }
        ],
        option: {
          type: "MultipleSelect",
          lazy: true,
          dataSource: {
            type: "url",
            value: "/xxx"
          }
        },
        compare: "jsonIn",
        value: []
      }
    ]
  },
  {
    value: "nextReceivePlainDisplay",
    label: "下次收款计划",
    isSelect: true,
    isSort: false,
    minWidth: "106",
    filterList: [
      {
        title: "下次收款计划",
        filterId: "fact_start_date",
        condition: [
          {
            label: "时间范围",
            value: "between"
          },
          {
            label: "大于某日",
            value: "gt"
          },
          {
            label: "等于某日",
            value: "eq"
          },
          {
            label: "小于某日",
            value: "lt"
          }
        ],
        option: {
          type: "SelectInput",
          lazy: false,
          dataSource: {},
          data: []
        },
        compare: "between",
        value: []
      }
    ]
  },
  {
    value: "followLogAbs",
    label: "跟进记录",
    isSelect: true,
    isSort: false,
    minWidth: "110",
    filterList: [
      {
        title: "所有记录",
        filterId: "follow_user_id",
        condition: [
          {
            label: "等于",
            value: "eq"
          }
        ],
        option: {
          type: "InputSelect",
          lazy: false,
          dataSource: {},
          data: [
            {
              label: "所有记录",
              value: "all"
            },
            {
              label: "我添加的记录",
              value: "my"
            }
          ]
        },
        compare: "jsonIn",
        value: [""]
      },
      {
        title: "最后一次跟进时间",
        filterId: "follow_last_date",
        condition: [
          {
            label: "时间范围",
            value: "between"
          },
          {
            label: "大于某日",
            value: "gt"
          },
          {
            label: "等于某日",
            value: "eq"
          },
          {
            label: "小于某日",
            value: "lt"
          }
        ],
        option: {
          type: "SelectInput",
          lazy: false,
          dataSource: {},
          data: []
        },
        compare: "between",
        value: []
      }
    ]
  },
  {
    value: "receiveExpAmountDisplay",
    label: "收款异常",
    isSelect: true,
    isSort: false,
    minWidth: "110",
    filterList: [
      {
        title: "收款异常",
        filterId: "receive_exp",
        condition: [
          {
            label: "等于",
            value: "eq"
          }
        ],
        option: {
          type: "InputSelect",
          lazy: false,
          dataSource: {},
          data: [
            {
              label: "是",
              value: true
            },
            {
              label: "否",
              value: false
            }
          ]
        },
        compare: "eq",
        value: [""]
      },
      {
        title: "异常金额",
        filterId: "receive_exp_amount",
        condition: [
          {
            label: "大于",
            value: "gt"
          }
        ],
        option: {
          type: "SelectInput",
          lazy: false,
          dataSource: {},
          data: []
        },
        compare: "gt",
        value: [""]
      },
      {
        title: "预期天数",
        filterId: "receive_exp_days",
        condition: [
          {
            label: "大于",
            value: "gt"
          }
        ],
        option: {
          type: "SelectInput",
          lazy: false,
          dataSource: {},
          data: []
        },
        compare: "gt",
        value: [""]
      }
    ]
  },
  {
    value: "alterTotalAmount",
    label: "变更金额",
    isSelect: false,
    isSort: false,
    minWidth: "106",
    filterList: []
  },
  {
    value: "contractPlainEndDate",
    label: "计划合同完工日期",
    isSort: true,
    isSelect: true,
    width: 130,
    filterList: [
      {
        title: "计划合同完工日期",
        filterId: "contract_plain_end_date",
        condition: [
          {
            label: "时间范围",
            value: "between"
          },
          {
            label: "大于某日",
            value: "gt"
          },
          {
            label: "等于某日",
            value: "eq"
          },
          {
            label: "小于某日",
            value: "lt"
          }
        ],
        option: {
          type: "SelectInput",
          lazy: false,
          dataSource: {},
          data: []
        },
        compare: "between",
        value: []
      }
    ]
  },
  {
    value: "internalPlainEndDate",
    label: "计划内控完工日期",
    isSort: true,
    isSelect: true,
    width: 130,
    filterList: [
      {
        title: "计划内控完工日期",
        filterId: "internal_plain_end_date",
        condition: [
          {
            label: "时间范围",
            value: "between"
          },
          {
            label: "大于某日",
            value: "gt"
          },
          {
            label: "等于某日",
            value: "eq"
          },
          {
            label: "小于某日",
            value: "lt"
          }
        ],
        option: {
          type: "SelectInput",
          lazy: false,
          dataSource: {},
          data: []
        },
        compare: "between",
        value: []
      }
    ]
  },
  {
    value: "maxFactEndDate",
    label: "实际完工日期",
    isSort: false,
    isSelect: false,
    width: 130,
    filterList: []
  },
  {
    value: "reformIngNumber",
    label: "正在整改",
    isSort: true,
    isSelect: false,
    minWidth: "87",
    filterData: []
  },
  {
    value: "taskProcess",
    label: "任务进度",
    isSelect: true,
    isSort: false,
    minWidth: "110",
    filterList: [
      {
        title: "任务进度",
        filterId: "task_id",
        condition: [
          {
            label: "在列表",
            value: "jsonIn"
          }
        ],
        option: {
          type: "MultipleSelect",
          lazy: true,
          dataSource: {
            type: "url",
            value: "/xxx"
          }
        },
        compare: "jsonIn",
        value: []
      }
    ]
  },
  {
    value: "isCraft",
    label: "验收计划",
    isSort: false,
    isSelect: false,
    minWidth: "110",
    filterList: []
  },
  {
    value: "buildLogNum",
    label: "施工日志",
    isSort: false,
    isSelect: false,
    minWidth: "110",
    filterList: []
  },
  {
    value: "remainDay",
    label: "剩余天数",
    isSelect: false,
    isSort: false,
    minWidth: "100",
    filterList: []
  },
  {
    value: "contractTotalAmountDisplay",
    label: "已收/合同总额",
    isSelect: true,
    isSort: false,
    minWidth: "106",
    filterList: [
      {
        title: "是否收款完成",
        filterId: "receive_complete",
        condition: [
          {
            label: "等于",
            value: "eq"
          }
        ],
        option: {
          type: "InputSelect",
          lazy: false,
          dataSource: {},
          data: [
            {
              label: "全部",
              value: null
            },
            {
              label: "已收齐",
              value: true
            },
            {
              label: "未收齐",
              value: false
            }
          ]
        },
        compare: "eq",
        value: []
      }
    ]
  }
];

/**
 * 表头字段对应的筛选组件
 */
export const headerCmps = {
  // 客户筛选
  customerName: cmps.ClientFilter,
  // 业务类型
  portraitName: cmps.BusinessType,
  // 责任人
  principal: cmps.PersonFilter,
  // 状态
  buildStatusDisplay: cmps.StateFilter,
  // 开工日期
  factStartDate: cmps.DateFilter,
  // 计划合同完工日期
  contractPlainEndDate: cmps.DateFilter,
  // 计划内控完工日期
  internalPlainEndDate: cmps.DateFilter,
  // 下次收款计划
  nextReceivePlainDisplay: cmps.DateFilter,
  // 跟进记录
  followLogAbs: cmps.FollowUpRecords,
  // 收款异常
  receiveExpAmountDisplay: cmps.AbnormalCollection,
  // 阶段进度
  stageProcess: cmps.StageProgress,
  // 任务进度
  taskProcess: cmps.TaskProgress,
  // 已收/合同总额
  contractTotalAmountDisplay: cmps.RadioSelect
};
/**
 * 筛选组件状态
 */
export const filterStatus = [
  {
    label: "未开始",
    value: "not_start"
  },
  {
    label: "进行中",
    value: "ing"
  },
  // {
  //   label: "超期",
  //   value: "time_out"
  // },
  // {
  //   label: "延期风险",
  //   value: "delay_risk"
  // },
  {
    label: "已停工",
    value: "shutdown"
  },
  {
    label: "已交付",
    value: "complete"
  }
];
